<h1 class="text-center" translate="DONATE.DONATIONS"></h1>

<loading-indicator hide="vm.donations"></loading-indicator>

<table class="table" ng-show="vm.donations">
	<tr>
		<th class="text-left" style="width: 150px;" translate="TORRENTS.DATE"></th>
		<th class="text-left" style="width: 120px;" translate="TORRENTS.USER"></th>
		<th class="text-left" style="width: 100px;" translate="ADMIN.SUM"></th>
		<th class="text-left" style="width: 100px;" translate="DONATE.METHOD"></th>
		<th class="text-left" style="width: 150px;">Voucher PIN</th>
		<th class="text-left" style="min-width: 300px;" translate="MAILBOX.MESSAGE"></th>
		<th class="text-center" style="width: 80px;" translate="DONATE.ACTION"></th>
		<th class="text-center" style="width: 80px;" translate="BUTTONS.EDIT"></th>
	</tr>
	<tr ng-repeat="donation in vm.donations">
		<td>{{ ::donation.added }}</td>
		<td><user user="::donation.user"></user></td>
		<td>{{ donation.sum }} {{ vm.currency }}</td>
		<td>
			<span ng-show="::donation.type == 1">Paysafe</span>
			<span ng-show="::donation.type == 2">Bitcoin</span>
			<span ng-show="::donation.type == 3">Paypal</span>
			<img ng-show="::donation.nostar == 0" ng-src="/img/icons/star-small.png" />
		</td>
		<td>{{ ::donation.code }}</td>
		<td>{{ ::donation.msg }}</td>
		<td class="text-center">
			<span ng-if="donation.status == 1" class="label label-success" translate="DONATE.CONFIRMED"></span>
			<button ng-if="donation.status == 0" class="btn btn-default btn-xs" ng-click="vm.confirmDonation(donation)" translate="BUTTONS.CONFIRM"></button>
		</td>
		<td class="text-center">
			<button ng-click="vm.edit(donation)" class="btn btn-xs btn-default"><i class="fa fa-pencil"></i></button>
			<button ng-click="vm.delete(donation)" class="btn btn-xs btn-default"><i class="fa fa-trash-o"></i></button>
		</td>
	</tr>
</table>
<div class="text-center">
	<uib-pagination max-size="10" items-per-page="vm.itemsPerPage" total-items="vm.totalItems" ng-model="vm.currentPage" ng-click="vm.getDonations()" previous-text="{{ 'PAGER.PREVIOUS' | translate }}" next-text="{{ 'PAGER.NEXT' | translate }}" boundary-links="true" first-text="{{ 'PAGER.FIRST' | translate }}" last-text="{{ 'PAGER.LAST' | translate }}"></uib-pagination>
</div>
